package jzqb.vo;

import cnki.tpi.kbatis.annotation.Column;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;



@Data
public class StandardStatisticsVo{
    private Integer id;

    @Column("题名")
    private String title;

    @Column("作者")
    private String author;

    @Column("文献来源")
    private String literatureSources;

    @Column("发表时间")
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    private String publishdate;

    @Column("全文")
    private String text;

    @Column("TABLENAME")
    private String tablename;

    @Column("来源数据库")//来源数据库,存放中文数据库名
    private String dbsource;

    @Column("来源表")//来源表,存放英文表名
    private String dbTable;

    @Column(value = "下载频次")//下载次数
    private Integer download;

    @Column("浏览量")//浏览次数
    private Integer browse;

    @Column("SYS_FLD_SYSID")//来源表唯一标识字段
    private Integer sysid;

    @Column("全局唯一标识")//全局唯一标识
    private String overallid;

    @Column(value = "文件名")
    private String filename;

    @Column("totalBROWSERATE")
    private Integer totalBROWSERATE;//总浏览次数

    @Column("totalDOWNLOADRATE")
    private Integer totalDOWNLOADRATE;//总下载次数

    @Column("totalRESOURCE")
    private String totalRESOURCE;//总标准条数

    public String getDbsource(){
        if(!("".equals(dbsource)) && dbsource != null){
            String[] db = {"JZCG_METADATA","JZZY_METADATA","JZQBZS_METADATA","JZQBBK_METADATA"};
            Boolean flag = false;
            for (String s : db) {
                if(s.equals(tablename)){
                    flag = true;
                    break;
                }
            }
            if(flag){
                dbsource = dbsource.substring(2,dbsource.length());
            }
        }
        return dbsource;
    }

    public Integer getBrowse(){
        if("".equals(browse) || browse == null){
            browse = 0;
        }
        return browse;
    }

    public Integer getTotalBROWSERATE(){
        if("".equals(totalBROWSERATE) || totalBROWSERATE == null){
            totalBROWSERATE = 0;
        }
        return totalBROWSERATE;
    }
}


